<?php
header("Content-Type: text/html;charset=utf-8");
include("../function/_nosql.php"); //
include("../function/function.php");
include("../_include.user.judge.php");
	$oeder = chkstr(trim($_REQUEST['oeder']));
	$subject = chkstr(trim($_REQUEST['subject']));
	$money = chkstr(trim($_REQUEST['money']));
    $zhi = chkstr(trim($_REQUEST['zhi']));
    $uid = $_SESSION['kboy_userid'];
    if($zhi == "fu"){
        if(getClassName("kboy_user","user_yu_e","uid = '$uid'") < $money){
            echo erro("余额不足，请充值");
        }
        mysql_query("update kboy_order set order_state=1 , order_payway=3 where order_no='$oeder'");
        webAD($uid,"活动支付成功","恭喜支付成功，您的订单号为".$oeder,$money);
        mysql_query("update kboy_user set user_yu_e=user_yu_e-".$money." where uid='$uid'");
		$time = date("Y-m-d H:i:s", time());
		$ztai = getClassName('kboy_jljilu','jl_ztai',"jl_danhao='$oeder'");
		if($ztai == 0){
		mysql_query("update kboy_jljilu set jl_ztai=1,jl_time='$time' where jl_danhao='$oeder'");
		}
		echo ok("支付成功","order.php");
    }
?>